<?php 
$user = wp_signon('', $secure_cookie);

$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);

$error_login_role="";
if ( !is_wp_error($user) )
{

	if($user->wp_capabilities['employer']=="1" || $user->wp_capabilities['administrator']=="1")
	{

		if(!session_is_registered('user_id_yer'))
		{
			session_register('user_id_yer');
			$_SESSION['user_id_yer'] = $user->id;
		}
	
		if(!session_is_registered('loged_yer'))
		{
			session_register('loged_yer');
			$_SESSION['loged_yer'] = $user->id;
		}
		
		if($_GET['sigin']=="defaut")
		{	
			$redirect_to = get_bloginfo( 'url' ) . "/";	
			wp_safe_redirect($redirect_to);	
			exit();	
		}	
		else	
		{	
			//$redirect_to = get_bloginfo( 'url' ) . "/?poststeps=4&id=".$_GET['id'];	
			wp_safe_redirect($redirect_to);	
			exit();	
		}
	}
	else
	{
		$error_login_role="1";
	}
	session_register('error_login_role');
	$_SESSION['error_login_role'] = $error_login_role;
}
?>